#!/bin/csh

# Plot 2-D velocity and 2X standard error by GMT 

# Set up region boundaries
   set bds=-124/-110/29/37

#---------------------Plot velocities--------------------------

#makecpt -Crainbow -I -T3.6/4.2/.02 >! anomaly.cpt

#makecpt -Crainbow -Z -T-0.1/0.15/.01 >! res.cpt
makecpt -Crainbow -Z -T0.0/.6/.1 >! res.cpt

# set fn1='resrow.020.334.80.25.242'
#*******************************************

#  set T='29s' 

#***************************************

#xyz2grd -R$bds -I.2 $fn1 -G$fn1.grd2
#surface -R$bds -I.36 $fn1 -G$fn1.grd2 -T0.5
#psbasemap -R$bds -JM5.5i -Ba2f2  -Y1.15 -K -P >! $fn1.ps
#psclip clippolySC -R$bds -JM5.5i -K -O -P >> $fn1.ps
#grdimage $fn1.grd2 -R$bds -Cres.cpt -JM5.5i -Ba2f2 -K -O -P >> $fn1.ps
#grdcontour $fn1.grd2 -C0.05 -JM5.5i -Ba2f2 -K -O -P >> $fn1.ps
#psclip -C -O -K >> $fn1.ps
#pscoast -R$bds -Di -A250 -JM5.5i  -W1p -Na -K -O -P >> $fn1.ps
#psxy staloclistSC.dat -R$bds -JM5.5i -Sc0.2c -G0/0/0 -N -: -O -K -P >> $fn1.ps
#psxy califedge -R$bds -JM5.5i -K -W1p -O -P >> $fn1.ps
#psxy monterrey -R$bds -JM5.5i -K -M -L -W1p -Gp0/17:B- -O -P >> $fn1.ps
#psscale -D2.5i/9i/5.5i/.25ih -B0.1:"$T phase velocity (km/s)":/:: -Cres.cpt -O -P >> $fn1.ps


#-------------------------Plot 2X standard error--------------------
foreach file (`ls residdiag.bl.*.134.50.* `)
set fn1=`echo $file `

#*******************************************

xyz2grd -R$bds -I.5 $fn1 -G$fn1.grd2
#surface -R$bds -I.36 $fn1 -G$fn1.grd2 
psbasemap -R$bds -JM5.5i -Ba2f2  -Y1.15 -K -P >! $fn1.ps
#psclip clippolyBL -R$bds -JM5.5i -K -O -P >> $fn1.ps
grdimage $fn1.grd2 -R$bds -Cres.cpt -JM5.5i -Ba2f2 -K -O -P >> $fn1.ps
grdcontour $fn1.grd2 -C0.05 -JM5.5i -Ba2f2 -K -O -P >> $fn1.ps
#psclip -C -O -K >> $fn1.ps
pscoast -R$bds -Di -A250 -JM5.5i  -W1p -Na -K -O -P >> $fn1.ps
psxy staloclistBL.dat -R$bds -JM5.5i -Sc0.2c -G0/0/0 -N -: -O -K -P >> $fn1.ps
psscale -D2.5i/9i/5.5i/.25ih -B0.02:"2x standard deviation":/:: -Cres.cpt -O -P >> $fn1.ps
end

